package com.xuecheng.auth.api;

import com.xuecheng.auth.model.po.XcTeacher;
import com.xuecheng.auth.service.XcTeacherService;
import com.xuecheng.base.exception.XueChengPlusException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api("教师相关接口")
@RestController
@RequestMapping("/teacher")
public class TeacherController {
    @Autowired
    XcTeacherService teacherService;

    @ApiOperation("保存教师")
    @PostMapping
    public XcTeacher saveTeacher(@RequestBody XcTeacher teacher) {
        return teacherService.saveTeacher(teacher);
    }

    @ApiOperation("查询教师")
    @GetMapping
    public XcTeacher getTeacher(@RequestBody XcTeacher teacher) {
        return teacherService.getTeacher(teacher);
    }
}
